<template>
  <div class="hzy_edit">
    <el-dialog
      title="编辑商品信息"
      :visible.sync="dialogVisible"
      width="1300px"
      :before-close="handleClose"
    >
      <span>
        <el-form
          :inline="true"
          class="demo-form-inline"
          :model="editAllocateList"
        >
          <el-form-item label="行号">
            <el-input
              :disabled="true"
              :value="editAllocateList.goodsId"
            ></el-input>
          </el-form-item>
          <el-form-item label="状态">
            <el-input
              :disabled="true"
              :value="editAllocateList.status"
            ></el-input>
          </el-form-item>
          <el-form-item label="单据编号">
            <el-input
              :disabled="true"
              :value="editAllocateList.documentNum"
            ></el-input>
          </el-form-item>
          <el-form-item label="创单日期">
            <el-input
              :disabled="true"
              :value="editAllocateList.createDate"
            ></el-input>
          </el-form-item>
          <el-form-item label="出库门店">
            <el-input v-model="editAllocateList.outboundStore"></el-input>
          </el-form-item>
          <el-form-item label="出库柜台">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.outboundCounter"
            ></el-input>
          </el-form-item>
          <el-form-item label="入库门店">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.inboundStore"
            ></el-input>
          </el-form-item>
          <el-form-item label="入库柜台">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.inboundcounter"
            ></el-input>
          </el-form-item>
          <el-form-item label="商品类型">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.category"
            ></el-input>
          </el-form-item>
          <el-form-item label="数量">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.count"
            ></el-input>
          </el-form-item>
          <el-form-item label="重量">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.totalWeight"
            ></el-input>
          </el-form-item>
          <el-form-item label="成本">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.totalPrice"
            ></el-input>
          </el-form-item>
          <el-form-item label="系数">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.series"
            ></el-input>
          </el-form-item>
          <el-form-item label="标签金额">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.LabelTotalPrice"
            ></el-input>
          </el-form-item>
          <el-form-item label="创单人">
            <el-input
              placeholder="请输入"
              v-model="editAllocateList.createPerson"
            ></el-input>
          </el-form-item>
          <el-form-item label="审批人">
            <el-input
              :disabled="true"
              v-model="editAllocateList.approver"
            ></el-input>
          </el-form-item>
          <el-form-item label="审批日期">
            <el-input
              :disabled="true"
              :value="editAllocateList.approvalDate"
            ></el-input>
          </el-form-item>
        </el-form>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button :plain="true" type="primary" @click="SaveMsg"
          >保存</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "EditAllocateInfo",
  props: ["viewList", "isShowEditAllocateInfo"],
  mounted() {
    this.dialogVisible = this.isShowEditAllocateInfo;
  },
  watch: {
    dialogVisible: function () {
      if (!this.dialogVisible) {
        this.$emit("closeEdit");
      }
    },
  },
  data() {
    return {
      dialogVisible: false,
      editAllocateList: this.viewList,
    };
  },
  methods: {
    handleClose(done) {
      this.$confirm("确认关闭？")
        .then(() => {
          done();
        })
        .catch(() => {});
    },
    EditInfo() {
      this.$emit("editClick");
      this.dialogVisible = true;
    },
    SaveMsg() {
      console.log(this.editAllocateList);
      this.dialogVisible = false;
      this.$message({
        message: "保存成功",
        type: "success",
      });
    },
  },
};
</script>